<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf"><{$tit}>列表</div>
                </div>
                <div class="am-tabs am-margin-bottom">
                    <{tabTit1($tabtit)}>
                </div>
                <div class="widget-body am-fr">
                    <{if $tips}>
                    <div class="tips am-margin-bottom-sm am-u-sm-12">
                        <div class="pre">
                            <p> 1：非常满意（100分）|较满意（80分）|一般满意（60分）|不满意（0分）|不了解（70分）</p>
                            <p> 2：是（0分）|否（100分）</p>
                        </div>
                    </div>
                    <{/if}>
                    <!-- 工具栏 -->
                    <div class="page_toolbar am-margin-bottom-xs am-cf">
                        <{include file='admin/public/toolbar.php'}>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <form id="form-opid" method="post" action="">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                            tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>
                                    <label class="am-checkbox-inline">
                                        <input type="checkbox" id="checkedAllBtn" data-am-ucheck />
                                        ID
                                    </label>
                                </th>
                                <th>标题</th>
                                <th>选项</th>
                                <th>维护安排</th>
                                <th>维护人员</th>
                                <!-- <th>科室人员</th> -->
                                <!-- <th>添加时间</th> -->
                                <th>排序</th>
                                <th>科室问题</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if ($list): foreach ($list as $val): ?>
                                <tr>
                                     <td class="am-text-middle">
                                        <p class="item-title"><?= $val['i'] ?></p>
                                    </td>
                                    <td class="am-text-middle">
                                        <label class="am-checkbox-inline">
                                            <input type="checkbox" name="opid[]" value="<?= $val['id'] ?>" data-am-ucheck />
                                            <?= $val['id'] ?>
                                        </label>
                                    </td>
                                    <td class="am-text-middle">
                                        <p class="item-title"><?= $val['title'] ?></p>
                                    </td>
                                    <td class="am-text-middle">
                                        <p class="item-title"><?= $val['options'] ?></p>
                                    </td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="#" class="item-admin tpl-table-black-operation-green"
                                                data-id="<?= $val['id'] ?>">
                                                <i class="am-icon-undo"></i> 维护安排
                                            </a>
                                        </div>
                                    </td>
                                    <td class="am-text-middle">
                                        <{if $val.is_keshi}>
                                            对应科室人员
                                        <{else}>
                                            <{if $val.admins}><{foreach $val.admins as $v}><{$admins[$v]['realname']}> 、 <{/foreach}><{/if}>
                                        <{/if}>
                                    </td>
                                    <!-- <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="#" class="item-shifu tpl-table-black-operation-green"
                                                data-id="<?= $val['id'] ?>">
                                                <i class="am-icon-undo"></i> 科室安排
                                            </a>
                                        </div>
                                    </td> -->
                                    <!-- <td class="am-text-middle">
                                        <{if $val.shifus}><{foreach $val.shifus as $v}><{$admins[$v]['realname']}> 、 <{/foreach}><{/if}></td>
                                    </td> -->
                                    <!-- <td class="am-text-middle"><?= $val['add_time'] ?></td> -->
                                    <td class="am-text-middle"><?= $val['sort'] ?></td>
                                     <td class="am-text-middle">
                                        <span class="item-keshi am-badge x-cur-p
                                                am-badge-<?= $val['is_keshi'] == 1 ? 'success' : 'warning' ?>"
                                                data-id="<?= $val['id'] ?>"
                                                data-state="<?= $val['is_keshi'] ?>">
                                            <?= $yesRadio[$val['is_keshi']] ?>
                                        </span>
                                    </td>

                                    <td class="am-text-middle">
                                        <{include file=$m.'/public/act.php'}>
                                    </td>
                                    <td class="am-text-middle">
                                        <{include file=$m.'/public/edit.php'}>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="5" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                        </form>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <{$showPage nofilter}>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 审核
        $('.j-act').opid('id', "/<{$routeUrl}>/act");
        // 隐藏
        $('.j-ban').opid('id', "/<{$routeUrl}>/ban");
        // 删除
        $('.j-del').opid('id', "/<{$routeUrl}>/del");

        // 状态
        $('.item-act').act('id', "/<{$routeUrl}>/act");
        // 删除元素
        $('.item-delete').delete('id', "/<{$routeUrl}>/del", '删除后不可恢复，确定要删除吗？');

        $('.j-auth').on('click', function () {
            var data = $(this).data();
            $.showModal({
                title: '用户授权'
                , area: '460px'
                , content: template('tpl-recharge', data)
                , uCheck: true
                , success: function ($content) {
                    // $content.find('.j-tabs').tabs({noSwipe: 1});
                }
                , yes: function ($content) {
                    $content.find('form').myAjaxSubmit({
                        url: '/<{$routeUrl}>/auth',
                        data: {id: data.id}
                    });
                    return true;
                }
            });
        });

        // 状态
        $('.j-qrcode1').opid('id', "/<{$routeUrl}>/qrcode1");
        // 状态
        $('.j-qrcode2').opid('id', "/<{$routeUrl}>/qrcode2");

        // open
        $('.item-admin').open('id', "/<{$routeUrl}>/auth_admin", '人员安排');
        // open
        $('.item-shifu').open('id', "/<{$routeUrl}>/auth_shifu", '人员安排');


        // 状态
        $('.item-keshi').act('id', "/<{$routeUrl}>/act_keshi");
    });
</script>